#!/bin/bash

mongodb1=192.168.0.122
port=${PORT:-27017}

echo "Waiting for  ${mongodb1} startup.."
until mongo --host ${mongodb1}:${port} --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' &>/dev/null; do
  printf '.'
  sleep 1
done


echo "Mongo stack all started.."

echo setup.sh time now: `date +"%T" `
mongo --host ${mongodb1}:${port} --authenticationDatabase admin -u root -p admin@123 <<EOF
   db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } );
EOF

